package com.neoCalf.neoFriend.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.neoCalf.neoCommon.utils.SendUtils;
import com.neoCalf.neoCommon.utils.SessionSeq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

/**
 * @author 小牛
 * @version 1.0
 * @description TODO
 * @date 2025/4/14 23:30
 */
@Configuration
@Slf4j
public class CommonConfig {
    @Bean
    @Scope("prototype")
    public SessionSeq sessionSeq() {
        return new SessionSeq();
    }

    @Bean
    public SendUtils sendUtils() {
        return new SendUtils();
    }

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        log.info("mybatis-plus分页插件加载完成");
        return mybatisPlusInterceptor;
    }
}
